import { defineConfig } from 'vitepress'
import { mdPlugin } from './config/plugins'

export default defineConfig({
  title: 'WitUI文档',
  description: '基于Element-plus基础组件封装使用',
  lang: 'zh',
  base: '/',
  lastUpdated: true,
  themeConfig: {
    logo: '/logo.svg',
    siteTitle: 'Wit-UI文档',
    outline: 3,
    socialLinks: [
      { icon: 'github', link: 'https://gitee.com/taiping520/wit-ui.git' },
    ],
    nav: [
      {
        text: '安装指南',
        link: '/components/',
      },
      { text: '组件', link: '/components/ImportExcel/base.md' },
      {
        text: '其它',
        items: [
          {
            text: 'Hooks',
            items: [
              {
                text: 'useExport',
                link: '/hooks/useExport.md',
              },
            ],
          },
          {
            text: '工具',
            link: 'https://juejin.cn/user/888061128344087/posts',
          },
        ],
      },
      {
        text: 'Gitee码云地址',
        link: 'https://gitee.com/taiping520/wit-ui.git',
      },
    ],
    sidebar: {
      '/components': [
        {
          text: '安装指南',
          items: [
            {
              text: '快速上手',
              link: '/components/',
            },
          ],
        },
        {
          text: '基础组件',
          items: [
            { text: '导入Excel', link: '/components/ImportExcel/base.md' },
            {
              text: '导出Excel',
              link: '/components/ExportExcel/base.md',
            },
            {
              text: 'Count计数',
              link: '/components/Count/base.md',
            },
          ],
        },
        {
          text: '高阶组件',
          items: [
            { text: '导出Excel', link: '/components/ExportExcel/base.md' },
          ],
        },
        {
          text: '数据展示',
          items: [
            {
              text: 'SplitText',
              link: '/components/SplitText/base.md',
            },
          ],
        },
      ],
      '/hooks': [
        {
          text: 'useExport',
          link: '/hooks/useExport.md',
        },
      ],
    },
  },
  markdown: {
    headers: {
      level: [0, 0],
    },
    // light: #f9fafb, dark: --vp-code-block-bg
    theme: { light: 'github-light', dark: 'github-dark' },
    config: (md) => mdPlugin(md),
  },
})
